Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[16.0][IMP] delivery_postlogistics: Print return label in status Ready #2

Open
wants to merge 3 commits into
base: 16.0
Choose a base branch
from

Conversation

QuocDuong1306
Copy link
Owner

No description provided.

@QuocDuong1306 QuocDuong1306 force-pushed the 16.0-Print-return-label-in-status-ready branch from 8f7ec47 to 8b70b5d Compare July 11, 2023 02:44
@QuocDuong1306 QuocDuong1306 changed the title [16.0][IMP] Print return label in status Ready [16.0][IMP] delivery_postlogistics: Print return label in status Ready Jul 11, 2023
@@ -156,3 +156,15 @@ def verify_credentials(self):
},
}
return message

def _compute_can_generate_return(self):
res =super(DeliveryCarrier, self)._compute_can_generate_return()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
res =super(DeliveryCarrier, self)._compute_can_generate_return()
res = super(DeliveryCarrier, self)._compute_can_generate_return()

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @nilshamerlinck , I'm done

@QuocDuong1306 QuocDuong1306 force-pushed the 16.0-Print-return-label-in-status-ready branch 2 times, most recently from abdf66f to dc74f33 Compare July 11, 2023 02:53
@QuocDuong1306 QuocDuong1306 force-pushed the 16.0-Print-return-label-in-status-ready branch from dc74f33 to 52fdf22 Compare July 11, 2023 05:06
_inherit = "stock.return.picking"

def _create_returns(self):
res = super(ReturnPicking, self)._create_returns()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
res = super(ReturnPicking, self)._create_returns()
new_picking, pick_type_id = super(ReturnPicking, self)._create_returns()


def _create_returns(self):
res = super(ReturnPicking, self)._create_returns()
record = self.env['stock.picking'].browse(res[0])

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
record = self.env['stock.picking'].browse(res[0])
picking = self.env['stock.picking'].browse(new_picking)

Comment on lines 9 to 10
if record:
record.carrier_id = self.picking_id.carrier_id and self.picking_id.carrier_id.id or False

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if record:
record.carrier_id = self.picking_id.carrier_id and self.picking_id.carrier_id.id or False
picking.write({"carrier_id": self.picking_id.carrier_id.id})

record = self.env['stock.picking'].browse(res[0])
if record:
record.carrier_id = self.picking_id.carrier_id and self.picking_id.carrier_id.id or False
return res

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return res
return new_picking, pick_type_id

class ReturnPicking(models.TransientModel):
_inherit = "stock.return.picking"

def _create_returns(self):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this will impact all returns
can you add a condition on self.picking_id.delivery_type == "postlogistics"

@QuocDuong1306 QuocDuong1306 force-pushed the 16.0-Print-return-label-in-status-ready branch from 52fdf22 to 2070e89 Compare July 11, 2023 07:27
@QuocDuong1306
Copy link
Owner Author

Hi @nilshamerlinck , I updated

@@ -1,2 +1,3 @@
from . import models
from . import postlogistics
from . import wizard

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please pre-commit

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why empty?

@QuocDuong1306 QuocDuong1306 force-pushed the 16.0-Print-return-label-in-status-ready branch from 2070e89 to 3b9214f Compare July 11, 2023 07:59
@QuocDuong1306
Copy link
Owner Author

Sorry @nilshamerlinck , could you review again?

@QuocDuong1306 QuocDuong1306 force-pushed the 16.0-Print-return-label-in-status-ready branch from 3b9214f to 8e09b12 Compare July 11, 2023 09:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants